import request from '../utils/request';
import Qs from 'qs';
let shop_id = localStorage.getItem('shopuuid')?localStorage.getItem('shopuuid'):''
console.log('44',shop_id)
import Cookies from 'js-cookie'

//const ApiRootUrl='/api';
export const ApiRootUrl='https://api.nashicike.top';
export const ApiUpDataUrl='https://api.admin.hikaw.top';

export const shopurl='http://www.nashicike.top/my/';
export const houtaiimagebucket='newxuejingimage';
export const houtairesbucket='newxuejingres';

//登录
export const loginData = data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/login/login',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

// (店铺装修)
//店铺创建
export const createShopData = data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/shop/createshop',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

export const checkById = data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/time_discount/checkById',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

//首页最近内容
export const homeindex = data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/admin/recently',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

//内容置顶
export const topping = data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/admin/topping',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

//内容置顶
export const usetemplate = data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/shop/usetemplate',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};
//登录token
export const getAuthtoken = data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/login/authLive',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

//获得店铺列表
export const getShopData = data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/shop/index',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};
//获得店铺列表
export const getKnowledgeList = data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/knowledge/getKnowledgeList',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

//店铺二维码
export const getShopErWeiMa = data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/shop/api',
        method: 'post',
		responseType:'arraybuffer',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};


export const getshowuploadicon = data => {
    return request({
        url: ApiRootUrl+'/admin/uploadfile/showuploadicon',
        method: 'get',
        params: data?Object.assign(data,{shop_id}):{shop_id}
    });
};

//获得店铺元素
export const getElementData = query => {
    return request({
        url: '/element.json',
        method: 'get',
        params: query?Object.assign(query,{shop_id}):{shop_id}
    });
};

//获得系统图标
export const getSysButton = query => {
    return request({
        url: '/sysbutton.json',
        method: 'get',
        params: query?Object.assign(query,{shop_id}):{shop_id}
    });
};

//获得店铺手机页面数据
export const getPhonePageData = data => {
   return request({
       headers: {
           'Content-Type': 'application/x-www-form-urlencoded'
       },
       url: ApiRootUrl+'/admin/shop/getphonepagedata',
       method: 'post',
       data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
   });
};

//获得店铺所有手机页面数据
export const getMorePhonePageData = data => {
   return request({
       headers: {
           'Content-Type': 'application/x-www-form-urlencoded'
       },
       url: ApiRootUrl+'/admin/shop/getmorephonepagedata',
       method: 'post',
       data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
   });
};

//保存店铺手机页面数据
export const addPhonePageData = data => {
   return request({
       headers: {
           'Content-Type': 'application/x-www-form-urlencoded'
       },
       url: ApiRootUrl+'/admin/shop/addphonepagedata',
       method: 'post',
       data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
   });
};

//删除店铺手机页面
export const deletePhonePage = data => {
   return request({
       headers: {
           'Content-Type': 'application/x-www-form-urlencoded'
       },
       url: ApiRootUrl+'/admin/shop/deletephonepage',
       method: 'post',
       data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
   });
};


//设置店铺手机页面为首页
export const setPhoneIndex = data => {
   return request({
       headers: {
           'Content-Type': 'application/x-www-form-urlencoded'
       },
       url: ApiRootUrl+'/admin/shop/setphoneindex',
       method: 'post',
       data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
   });
};

//店铺装修轮播图片上传图片保存到服务器
// export const uploadImg = data => {
//     return request({
//         headers: {
//             'Content-Type': 'application/x-www-form-urlencoded'
//         },
//         url: ApiRootUrl+'/admin/shop/uploadimg',
//         method: 'post',
//         data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
//     });
// };

//测试代码
export const test = data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/user/index/index',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

//聊天
export const getuserChatList = query => {
    return request({
        url: ApiRootUrl+'/user/chat/getUserChatList',
        method: 'get',
        params: query?Object.assign(query,{shop_id}):{shop_id}
    });
};

// 底部导航
export const customListData = query => {
    return request({
        url: ApiRootUrl+'/admin/page',
        method: 'get',
        params: query?Object.assign(query,{shop_id}):{shop_id}
    });
};

export const footerNavListData = query => {
    return request({
        url: ApiRootUrl+'/admin/config',
        method: 'get',
        params: query?Object.assign(query,{shop_id}):{shop_id}
    });
};

export const editFooterNavData = data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/config/edit',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

// (内容类型)

// 分类
export const classifyListData  = data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/category',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

export const addClassifyData = data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/category/add',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

export const editClassifyData = data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/category/edit',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

export const delClassifyData = data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/category/del',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

// 分组
export const fenZuData  = data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/fenzu',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

export const addFenZuData = data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/fenzu/add',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

export const editFenZuData = data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/fenzu/edit',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

export const delFenZuData = data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/fenzu/del',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

// 课程
export const videoListData = query => {
    return request({
        url: ApiRootUrl+'/admin/knowledge',
        method: 'get',
        params: query?Object.assign(query,{shop_id}):{shop_id}
    });
};

// 课程
export const getURLById = query => {
    return request({
        url: ApiRootUrl+'/admin/shop/getURLById',
        method: 'get',
        params: query?Object.assign(query,{shop_id}):{shop_id}
    });
};

//添加视频
export const addVideoData = data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/knowledge/add',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

export const delVideoData = data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/knowledge/del',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

//专栏
export const columnListData = query => {
    return request({
        url: ApiRootUrl+'/admin/Column',
        method: 'get',
        params: query?Object.assign(query,{shop_id}):{shop_id}
    });
};

export const addColumnData = data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/Column/add',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

export const delColumnData = data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/Column/del',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

export const manageColumnData = data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/Column/manage',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

// (直播)

//公开课
//显示公开课
export const smallClassListData = query => {
    return request({
        url: ApiRootUrl+'/admin/live_course',
        method: 'get',
        params: query?Object.assign(query,{shop_id}):{shop_id}
    });
};

//添加公开课
export const addSmallClassData = data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/live_course/add',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

//删除公开课
export const delSmallClassData = data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/live_course/del',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

//显示更新直播时间
export const showandupdateLiveTime = data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/live_course/showandupdate',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

//获得直播地址
export const getPushUrl = data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/live_course/getpushurl',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

//获得直播地址
export const getPayUserListDetail = data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/admin/getPayUserListDetail',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};


// (助学工具)

//题库
export const questionCategoryListData = query => {
    return request({
        url: ApiRootUrl+'/admin/question/category_list',
        method: 'get',
        params: query?Object.assign(query,{shop_id}):{shop_id}
    });
};

export const addQuestionCategoryData = data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/question/category_add',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

export const editQuestionCategoryData = data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/question/category_edit',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

export const delQuestionCategoryData = data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/question/category_del',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

export const questionListData = query => {
    return request({
        url: ApiRootUrl+'/admin/question',
        method: 'get',
        params: query?Object.assign(query,{shop_id}):{shop_id}
    });
};

export const addQuestionData = data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/question/add',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

export const delQuestionData = data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/question/del',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

//试卷
export const examListData = query => {
    return request({
        url: ApiRootUrl+'/admin/exam',
        method: 'get',
        params: query?Object.assign(query,{shop_id}):{shop_id}
    });
};

export const addExamData = data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/exam/add',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

export const delExamData = data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/exam/del',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

export const examManageListData = query => {
    return request({
        url: ApiRootUrl+'/admin/exam/paper',
        method: 'get',
        params: query?Object.assign(query,{shop_id}):{shop_id}
    });
};

export const examManageData = data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/exam/paper_question',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

// 考试
export const examLogListData = query => {
    return request({
        url: ApiRootUrl+'/admin/exam/exam_log',
        method: 'get',
        params: query?Object.assign(query,{shop_id}):{shop_id}
    });
};

export const delExamLogData = data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/exam/exam_log_del',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

export const examDetailData = query => {
    return request({
        url: ApiRootUrl+'/admin/exam/exam_result',
        method: 'get',
        params: query?Object.assign(query,{shop_id}):{shop_id}
    });
};

export const examdetailData = query => {
    return request({
		headers: {
		    'Content-Type': 'application/x-www-form-urlencoded',
		},
        url: ApiRootUrl+'/user/exam/exam_result',
        method: 'get',
        params: query?Object.assign(query,{shop_id}):{shop_id}
    });
};

// 答题记录
export const answerRecordListData = query => {
    return request({
        url: ApiRootUrl+'/admin/exam/questions_record',
        method: 'get',
        params: query?Object.assign(query,{shop_id}):{shop_id}
    });
};

// (讲师管理)

// 讲师列表
export const lecturerListData = query => {
    return request({
        url: ApiRootUrl+'/admin/teacher',
        method: 'get',
        params: query?Object.assign(query,{shop_id}):{shop_id}
    });
};

export const addLecturerData = data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/teacher/add',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

export const delLecturerData = data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/teacher/del',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

// 讲师佣金
export const commissionListData = query => {
    return request({
        url: ApiRootUrl+'/admin/teacher/capitalflow',
        method: 'get',
        params: query?Object.assign(query,{shop_id}):{shop_id}
    });
};

// 讲师提现
export const withdrawListData = query => {
    return request({
        url: ApiRootUrl+'/admin/teacher/withdraw_list',
        method: 'get',
        params: query?Object.assign(query,{shop_id}):{shop_id}
    });
};

export const dealWithdrawData = data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/teacher/withdraw_do',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

// 讲师配置
export const setListData = query => {
    return request({
        url: ApiRootUrl+'/admin/teacher/config',
        method: 'get',
        params: query?Object.assign(query,{shop_id}):{shop_id}
    });
};

export const lecturerSetData = data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/teacher/config',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

// (用户管理)

// 用户列表
export const userListData = query => {
    return request({
        url: ApiRootUrl+'/admin/member/member_list',
        method: 'get',
        params: query?Object.assign(query,{shop_id}):{shop_id}
    });
};

export const modifyUserStatus = data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/member/modifyuserstatus',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};


// 会员设置
export const memberSetListData = query => {
    return request({
        url: ApiRootUrl+'/admin/member/member_type_list',
        method: 'get',
        params: query?Object.assign(query,{shop_id}):{shop_id}
    });
};

export const addMemberCardData = data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/member/member_type_add',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

// 会员列表
export const memberListData = query => {
    return request({
        url: ApiRootUrl+'/admin/member',
        method: 'get',
        params: query?Object.assign(query,{shop_id}):{shop_id}
    });
};

export const addMemberData = data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/member/add',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

export const delMemberData = data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/member/del',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

// (交易)

// 订单管理
export const orderListData = query => {
    return request({
        url: ApiRootUrl+'/admin/order',
        method: 'get',
        params: query?Object.assign(query,{shop_id}):{shop_id}
    });
};

export const refundListData = query => {
    return request({
        url: ApiRootUrl+'/admin/refund',
        method: 'get',
        params: query?Object.assign(query,{shop_id}):{shop_id}
    });
};

export const orderDetailData = query => {
    return request({
        url: ApiRootUrl+'/admin/order/info',
        method: 'get',
        params: query?Object.assign(query,{shop_id}):{shop_id}
    });
};

export const refundDetailData = query => {
    return request({
        url: ApiRootUrl+'/admin/refund/info',
        method: 'get',
        params: query?Object.assign(query,{shop_id}):{shop_id}
    });
};

export const replyEvaluateData = data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/order/evaluate_reply',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

export const editEvaluateData = data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/order/evaluate_update',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

export const delEvaluateData = data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/order/evaluate_del',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

export const delOrderData = data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/order/del',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

export const delRefundData = data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/refund/del',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

//(营销中心)

//(营销中心-营销玩法)

// 推广员
export const promoterSetData = query => {
    return request({
        url: ApiRootUrl+'/admin/Promoter/config',
        method: 'get',
        params: query?Object.assign(query,{shop_id}):{shop_id}
    });
};

export const promoterSetEditData = data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/Promoter/config',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

export const promoterListData = query => {
    return request({
        url: ApiRootUrl+'/admin/Promoter',
        method: 'get',
        params: query?Object.assign(query,{shop_id}):{shop_id}
    });
};

export const promoterStatusData = data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/Promoter/change_status',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

export const delPromoterData = data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/Promoter/del',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

export const promoterOrderListData = query => {
    return request({
        url: ApiRootUrl+'/admin/Promoter/order_list',
        method: 'get',
        params: query?Object.assign(query,{shop_id}):{shop_id}
    });
};

export const capitalflowListData = query => {
    return request({
        url: ApiRootUrl+'/admin/Promoter/capitalflow',
        method: 'get',
        params: query?Object.assign(query,{shop_id}):{shop_id}
    });
};

export const promoterWithdrawListData = query => {
    return request({
        url: ApiRootUrl+'/admin/Promoter/withdraw',
        method: 'get',
        params: query?Object.assign(query,{shop_id}):{shop_id}
    });
};

export const withdrawPayData = data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/Promoter/withdraw_pay',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

export const withdrawDelData = data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/Promoter/withdraw_del',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

export const promoterRecordListData = query => {
    return request({
        url: ApiRootUrl+'/admin/Promoter/record',
        method: 'get',
        params: query?Object.assign(query,{shop_id}):{shop_id}
    });
};

// 邀请码
export const courseCardListData = query => {
    return request({
        url: ApiRootUrl+'/admin/Card/kcard_list',
        method: 'get',
        params: query?Object.assign(query,{shop_id}):{shop_id}
    });
};

export const addCourseCardData = data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/Card/kcard_add',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

export const delCourseCardData = data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/Card/kcard_del',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

export const courseCardInfoData = data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/Card/kcard_info',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

export const activationCodeListData = query => {
    return request({
        url: ApiRootUrl+'/admin/Card/kcdkey_list',
        method: 'get',
        params: query?Object.assign(query,{shop_id}):{shop_id}
    });
};

export const ProductActivationCodeData = data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/Card/kcdkey_generate',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

export const distributeActivationCodeData = data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/Card/kcdkey_distribute',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

export const delActivationCodeData = data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/Card/kcdkey_del',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

export const memberCardListData = query => {
    return request({
        url: ApiRootUrl+'/admin/Card/mcard_list',
        method: 'get',
        params: query?Object.assign(query,{shop_id}):{shop_id}
    });
};

export const addCardData = data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/Card/mcard_add',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

export const delCardData = data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/Card/mcard_del',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

export const memberCardInfoData = query => {
    return request({
        url: ApiRootUrl+'/admin/Card/mcard_info',
        method: 'get',
        params: query?Object.assign(query,{shop_id}):{shop_id}
    });
};

export const memberActivationCodeListData = query => {
    return request({
        url: ApiRootUrl+'/admin/Card/mcdkey_list',
        method: 'get',
        params: query?Object.assign(query,{shop_id}):{shop_id}
    });
};

export const ProductMemberActivationCodeData = data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/Card/mcdkey_generate',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

export const distributeMemberActivationCodeData = data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/Card/mcdkey_distribute',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

export const delMemberActivationCodeData = data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/Card/mcdkey_del',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

// 优惠券
export const couponListData = query => {
    return request({
        url: ApiRootUrl+'/admin/Coupon',
        method: 'get',
        params: query?Object.assign(query,{shop_id}):{shop_id}
    });
};

// 优惠券(新)
export const couponListDataNew = query => {
    return request({
		url: ApiRootUrl+'/admin/Coupon/getCouponListByShopId',
        method: 'get',
        params: query?Object.assign(query,{shop_id}):{shop_id}
    });
};

export const addCouponData = data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/Coupon/add',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

export const delCouponData = data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/Coupon/del',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

// 请好友看
export const inviteFriendSeeListData = query => {
    return request({
        url: ApiRootUrl+'/admin/Share_use',
        method: 'get',
        params: query?Object.assign(query,{shop_id}):{shop_id}
    });
};

export const setInviteFriendSeeData = data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/Share_use/edit',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

// 拼团
export const pinListData = query => {
    return request({
        url: ApiRootUrl+'/admin/pin',
        method: 'get',
        params: query?Object.assign(query,{shop_id}):{shop_id}
    });
};

export const addPinData = data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/pin/add',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

export const delPinData = data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/pin/del',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

// 兑换码
export const exchangeCodeListData = query => {
    return request({
        url: ApiRootUrl+'/admin/Redeem',
        method: 'get',
        params: query?Object.assign(query,{shop_id}):{shop_id}
    });
};

export const addExchangeCodeData = data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/Redeem/add',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

export const exchangeCodeInfoData = data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/Redeem/info',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

export const exchangeCodeDetailListData = query => {
    return request({
        url: ApiRootUrl+'/admin/Redeem/keycode_list',
        method: 'get',
        params: query?Object.assign(query,{shop_id}):{shop_id}
    });
};

export const productExchangeCodeData = data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/Redeem/keycode_generate',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

export const distributeExchangeCodeData = data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/Redeem/keycode_distribute',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

export const delExchangeCodeDetailData = data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/Redeem/keycode_del',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

export const delExchangeCodeData = data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/Redeem/del',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

// 涨粉神器
export const increaseFansListData = query => {
    return request({
        url: ApiRootUrl+'/admin/increase_fans',
        method: 'get',
        params: query?Object.assign(query,{shop_id}):{shop_id}
    });
};

export const addIncreaseFansData = data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/increase_fans/add',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

export const delIncreaseFansData = data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/increase_fans/del',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

// 秒杀
export const seckillListData = query => {
    return request({
        url: ApiRootUrl+'/admin/Seckill',
        method: 'get',
        params: query?Object.assign(query,{shop_id}):{shop_id}
    });
};

export const addSeckillData = data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/Seckill/add',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

export const delSeckillData = data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/Seckill/del',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

// 限时折扣
export const limitDiscountListData = query => {
    return request({
        url: ApiRootUrl+'/admin/time_discount',
        method: 'get',
        params: query?Object.assign(query,{shop_id}):{shop_id}
    });
};

export const addLimitDiscountData = data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/time_discount/add',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

export const delLimitDiscountData = data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/time_discount/del',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

// 商品推荐
export const goodsRecommendListData = query => {
    return request({
        url: ApiRootUrl+'/admin/recommended_goods',
        method: 'get',
        params: query?Object.assign(query,{shop_id}):{shop_id}
    });
};

export const addGoodsRecommendData = data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/recommended_goods/add',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

export const delGoodsRecommendData = data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/recommended_goods/del',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

// 弹窗广告
export const advertisePopListData = query => {
    return request({
        url: ApiRootUrl+'/admin/Advert',
        method: 'get',
        params: query?Object.assign(query,{shop_id}):{shop_id}
    });
};



export const addAdvertisePopData = data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/Advert/add',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

export const delAdvertisePopData = data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/Advert/del',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

// 支付有礼
export const payPolitelyListData = query => {
    return request({
        url: ApiRootUrl+'/admin/Apply_gift',
        method: 'get',
        params: query?Object.assign(query,{shop_id}):{shop_id}
    });
};

export const addPayPolitelyData = data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/Apply_gift/add',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

export const delPayPolitelyData = data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/Apply_gift/del',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

//(设置)

// 公告管理
export const announceListData = query => {
    return request({
        url: ApiRootUrl+'/admin/announce',
        method: 'get',
        params: query?Object.assign(query,{shop_id}):{shop_id}
    });
};

export const addAnnounceData = data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/announce/add',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

export const editAnnounceData = data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/announce/edit',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

export const delAnnounceData = data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/announce/del',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

// 建议/意见
export const feedbackListData = query => {
    return request({
        url: ApiRootUrl+'/admin/feedback',
        method: 'get',
        params: query?Object.assign(query,{shop_id}):{shop_id}
    });
};

export const delFeedbackData = data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/feedback/del',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

// 拖拽菜单
export const menuListData = query => {
    return request({
        url: ApiRootUrl+'/admin/admin/get_menu_rules',
        method: 'get',
        params:query?Object.assign(query,{shop_id}):{shop_id}
    });
};

export const setMenuData = data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/admin/set_menu_rules',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

//(服务)

//(权限管理)

// 账号管理
export const accountListData = query => {
    return request({
        url: ApiRootUrl+'/admin/admin',
        method: 'get',
        params: query?Object.assign(query,{shop_id}):{shop_id}
    });
};

export const addAccountData = data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/admin/add',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

export const addAuth = data => {
    return request({
        // headers: {
        //     'Content-Type': 'application/x-www-form-urlencoded'
        // },
        // https://api.xuejing.pro/admin/staff/addAuth
        url: ApiRootUrl+'/admin/staff/addAuth',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};


export const delAccountData = data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/admin/del',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

// 账号权限
export const accountLimitsListData = query => {
    return request({
        url: ApiRootUrl+'/admin/admin/get_auth_group',
        method: 'get',
        params: query?Object.assign(query,{shop_id}):{shop_id}
    });
};

export const setLimitsData = data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/admin/set_auth_group',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

export const orderData = query => {
    return request({
        url: './order.json',
        method: 'get',
        params: query?Object.assign(query,{shop_id}):{shop_id}
    });
};

export const settingData = query => {
    return request({
        url: './setting.json',
        method: 'get',
        params: query?Object.assign(query,{shop_id}):{shop_id}
    });
};

export const indexData = query => {
    return request({
        url: './index.json',
        method: 'get',
        params: query?Object.assign(query,{shop_id}):{shop_id}
    });
};

//获得阿里云ststoken
export const getstsToken = query =>{
	return request({
	    url: ApiRootUrl+'/admin/admin/getststoken',
	    method: 'get',
	    params: query
	});
}

//获得阿里云ststoken
export const getstsVideoToken = query =>{
	return request({
	    url: ApiRootUrl+'/admin/admin/getstsvideotoken',
	    method: 'get',
	    params: query?Object.assign(query,{shop_id}):{shop_id}
	});
}

//刷新令牌token
export const refreshToken = data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/admin/refreshtoken',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

// api/file/getAttachmentList
export const api_getAttachmentList = data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded',
             'authkey':Cookies.get('authToken') || '',
        },
        url: ApiUpDataUrl+'/api/file/getAttachmentList',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id,live_id:shop_id}):{shop_id})
    });
};
export const api_getPolicy = data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded',
            'authkey': Cookies.get('authToken') || '',
        },
        url: ApiUpDataUrl+'/api/file/getPolicy',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id,live_id:shop_id}):{shop_id})
    });
};
export const api_uploadCallback = data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded',
            'authkey': Cookies.get('authToken') || '',
        },
        url: ApiUpDataUrl+'/api/file/uploadCallback',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id,live_id:shop_id}):{shop_id})
    });
};
// export const api_getPolicy = (data) => request.get("file/getPolicy", data)
//上传组件
//上传插入到数据库
export const insertUploadImage = data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/uploadfile/insertuploadimage',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

//获得显示上传的图片列表
export const showUploadImage= data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/uploadfile/showuploadimage',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

export const deleteUploadImage= data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/uploadfile/deleteuploadimage',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

export const insertUploadAudio = data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/uploadfile/insertuploadaudio',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

//获得显示上传的音频列表
export const showUploadAudio= data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/uploadfile/showuploadaudio',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

export const deleteUploadAudio= data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/uploadfile/deleteuploadaudio',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};
//获得显示上传的视频列表
export const insertUploadVideo = data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/uploadfile/insertuploadvideo',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

export const showUploadVideo= data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/uploadfile/showuploadvideo',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

export const deleteUploadVideo= data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/uploadfile/deleteuploadvideo',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

//获得显示上传的文件列表
export const insertUploadFiles = data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/uploadfile/insertuploadfiles',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

export const showUploadFiles= data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/uploadfile/showuploadfiles',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

export const deleteUploadFiles= data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/uploadfile/deleteuploadfiles',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

//点击我的店铺存储shopuuid
export const storageShopuuid= data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/admin/storageshopuuid',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

//查询客服
export const getKeFu = query => {
    return request({
        url: ApiRootUrl+'/admin/kefu/getkefu',
        method: 'get',
        params: query?Object.assign(query,{shop_id}):{shop_id}
    });
};

//添加客服
export const addKeFu= data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/kefu/add',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

//更新客服
export const updateKeFu= data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/kefu/update',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

//删除客服
export const delKeFu= data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/kefu/del',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

//客服登录
// export const kefuLogin= data => {
//     return request({
//         headers: {
//             'Content-Type': 'application/x-www-form-urlencoded'
//         },
//         url: ApiRootUrl+'/admin/login/kefulogin',
//         method: 'post',
//         data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
//     });
// };

//得到与客服聊天的用户列表
export const getUserChatList = data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/chat/getuserchatlist',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};
//得到与用户聊天的消息
export const getuserchatList = data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/user/record/getUserChatList',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

//得到与用户聊天的消息
export const getChatContent = data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/chat/getchatcontent',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

//发送给用户的聊天消息
export const sendUserChat = data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/chat/senduserchat',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

//发送给用户的聊天消息
export const updateUserChatFlag = data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/chat/updateuserchatflag',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

//查询全部菜单
export const getXjMenu = query => {
    return request({
        url: ApiRootUrl+'/admin/admin/getxjmenu',
        method: 'get',
        params: query?Object.assign(query,{shop_id}):{shop_id}
    });
};

//添加全部菜单
export const addXjMenu = data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/admin/addxjmenu',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

//查询所有员工
export const staffData = data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/staff',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

//管理员列表
export const adminListData = query => {
    return request({
        url: ApiRootUrl+'/admin/staff/admin',
        method: 'get',
        params: query?Object.assign(query,{shop_id}):{shop_id}
    });
};

//查询管理员分组
export const getGroupId = query => {
    return request({
        url: ApiRootUrl+'/admin/staff/getgroupid',
        method: 'get',
        params: query?Object.assign(query,{shop_id}):{shop_id}
    });
};

//编辑员工管理数据
export const editStaffData = data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/staff/add',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

//编辑员工管理数据
export const stopStaffData = data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/staff/stopstatus',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

//删除员工管理数据
export const delStaffData = data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/staff/del',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

//选择员工判断是否已经存在
export const existStaffData = data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/staff/exist',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

//用户注册在线教育系统
export const register = data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/admin/register',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};


//员工权限添加
export const addRoleAuth = data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/staff/addrole',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

// 账号权限
export const getRoleAuth = query => {
    return request({
        url: ApiRootUrl+'/admin/staff/getrole',
        method: 'get',
        params: query?Object.assign(query,{shop_id}):{shop_id}
    });
};

//查询员工权限菜单
export const getRoleMenu = query => {
    return request({
        url: ApiRootUrl+'/admin/staff/getrolemenu',
        method: 'get',
        params: query?Object.assign(query,{shop_id}):{shop_id}
    });
};

//设置员工权限成功
export const setRoleAuthData = data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/staff/setroleauth',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

//删除员工
export const delEmplyee= data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/staff/delEmplyee',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

//知识和试卷
export const keListData = query => {
    return request({
        url: ApiRootUrl+'/admin/knowledge/keindex',
        method: 'get',
        params: query?Object.assign(query,{shop_id}):{shop_id}
    });
};

//搜索知识试卷
export const searchKE= data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/knowledge/searchke',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

//权限验证
export const authLogin= data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/admin/authlogin',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

//得到店铺用户信息
export const getShopUserInfo= query => {
    return request({
        url: ApiRootUrl+'/admin/admin/getshopuserinfo',
        method: 'get',
        params: query?Object.assign(query,{shop_id}):{shop_id}
    });
};

//得到店铺用户信息
export const getShopPayInfo= query => {
    return request({
        url: ApiRootUrl+'/admin/admin/getshoppayinfo',
        method: 'get',
        params: query?Object.assign(query,{shop_id}):{shop_id}
    });
};

//获取公众号配置
export const getPublicAccount= data => {
	return request({
	    headers: {
	        'Content-Type': 'application/x-www-form-urlencoded'
	    },
	    url: ApiRootUrl+'/admin/public_account/getPublicAccount',
	    method: 'post',
	    data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
	});
};

//保存公众号配置
export const savePublicAccount= data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/public_account/savePublicAccount',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

//获取公众号配置
export const getWeChatPayConfig= data => {
	return request({
	    headers: {
	        'Content-Type': 'application/x-www-form-urlencoded'
	    },
		
	    url: ApiRootUrl+'/admin/public_account/getPublicAccount',
	    method: 'post',
	    data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
	});
};

//保存支付配置
export const saveWeChatPayConfig= data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/public_account/saveWeChatPayConfig',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

//保存网校提现账号信息
export const saveSchoolPayInfo= data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/pay/saveschoolpayinfo',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

//得到网校提现账号信息
export const getSchoolPayInfo= query => {
    return request({
        url: ApiRootUrl+'/admin/pay/getschoolpayinfo',
        method: 'get',
        params: query?Object.assign(query,{shop_id}):{shop_id}
    });
};

//添加网校提现订单
export const addPayOrder= data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/pay/addpayorder',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

//得到网校提现订单
export const getSchoolPayList= data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/pay/getschoolpaylist',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

//添加专栏下载资料
export const addColumnDownFile= data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/column/addcolumndownfile',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

//添加专栏下载资料
export const getColumnDownFile= data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/column/getcolumndownfile',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

//添加专栏下载资料
export const searchColumnDownFile= data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/column/searchcolumndownfile',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

//移除专栏下载资料
export const removeFile= data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/column/removefile',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

//添加购买版本订单
export const addVerOder= data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/pay/addverorder',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

//添加购买版本订单
export const setShopType= data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        url: ApiRootUrl+'/admin/shop/setshoptype',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

//添加购买版本订单
export const api_loadPopAds= data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded',
            // 'domainname':$localhost.get()
        },
        url: ApiRootUrl+'/user/user/loadPopAds',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

//添加购买版本订单
export const api_shareInfoInviteFriend= data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded',
            // 'domainname':$localhost.get()
        },
        url: ApiRootUrl+'/user/knowledge/shareInfoInviteFriend',
        method: 'post',
        data: Qs.stringify(data?Object.assign(data,{shop_id}):{shop_id})
    });
};

//  拼团活动列表
export const api_teamWorkTableList = data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded',
            // 'domainname':$localhost.get()
        },
        url: ApiRootUrl+'/admin/spell_group/spellGroupList',
        method: 'get',
        params: data?Object.assign(data,{shop_id}):{shop_id}
    });
};

//  拼团活动列表行编辑
export const api_teamWorkTableCellEdit = data => {
    return request({
        headers: {
          'Content-Type': 'application/x-www-form-urlencoded',
            // 'domainname':$localhost.get()
        },
        url: ApiRootUrl+'/admin/spell_group/spellGroupEdit',
        method: 'post',
        params: data
    });
};

//  拼团活动列表行失效
export const api_teamWorkTableCellLose = data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded',
            // 'domainname':$localhost.get()
        },
        url: ApiRootUrl+'/admin/spell_group/spellGroupLapse',
        method: 'post',
        params: data
    });
};

//  拼团活动列表行删除
export const api_teamWorkTableCellDelete = data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded',
            // 'domainname':$localhost.get()
        },
        url: ApiRootUrl+'/admin/spell_group/spellGroupDelete',
        method: 'post',
        params: data
    });
};

//  创建拼团
export const api_CreateTeamWork = data => {
    return request({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded',
            // 'domainname':$localhost.get()
        },
        url: ApiRootUrl+'/admin/spell_group/createSpellGroup',
        method: 'post',
        params: data
    });
};


// // 弹窗广告
// export const api_loadPopAds = query => {
//     return request({
//         url: ApiRootUrl+'/user/user/loadPopAds',
//         method: 'get',
//         params: query
//     });
// };


// let http=that.$axios.create({
//         timeout: 5000
//         headers: {'token': Cookies.get('token')||''}
//         });
		
// let res = await http.get("/api/admin/admin/getststoken")

